// 路由
import Vue from 'vue'
import VueRouter from 'vue-router'
// 一级路由
import XiaBian from '@/views/xia-bian'
import DengLu from '@/views/deng-lu'
import ShouCang from '@/views/shou-cang'
import ZhuCe from '@/views/zhu-ce'
import ChengshiSuoyin from '@/views/chengshi-suoyin'
import DiTu from '@/views/di-tu'
// 二级路由
import ShouYe from '@/views/erjiliyou/shou-ye'
import ZhaoFang from '@/views/erjiliyou/zhao-fang'
import ZiXun from '@/views/erjiliyou/zi-xun'
import WoDe from '@/views/erjiliyou/wo-de'

Vue.use(VueRouter)

const routes = [
  {
    path: '/chengshisuoyin',
    component: ChengshiSuoyin
  },
  {
    path: '/denglu',
    component: DengLu
  },
  {
    path: '/shoucang',
    component: ShouCang
  },
  {
    path: '/zhuce',
    component: ZhuCe
  },
  {
    path: '/ditu',
    component: DiTu
  },
  {
    path: '/',
    component: XiaBian,
    redirect: '/shouye', // 重定向 如果匹配到的路径是 / 时，会定向到article
    children: [
      {
        path: '/shouye',
        component: ShouYe
      },
      {
        path: '/zhaofang',
        component: ZhaoFang
      },
      {
        path: '/zixun',
        component: ZiXun
      },
      {
        path: '/wode',
        component: WoDe
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
